<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台主页</title>
    <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.js"></script>
</head>

<body>
    <h1>后台主页</h1>
    <button id="btn">退出登录</button>
</body>
<script>
   $(function(){
    $.get('/api/username',res=>{
        if(res.status==0){
            alert('恭喜你登录成功'+res.username)
        }else{
            alert('登录失败')
            location.href='/01/login.html'
        }
    })
   })
</script>

</html>